add ContentFilteredTopic example.#341
Conversation
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
fujitatomoya
left a comment
There was a problem hiding this comment.
just trying to use all interfaces provided by subscription content filtering here. and dealing with exceptions that might be generated via methods since users are likely to copy&paste the code from here to somewhere else.
wjwwood
left a comment
There was a problem hiding this comment.
The example could be more "minimal" for copy-paste, but I think it's fine as-is to show more of how it could be used.
lgtm, with some suggestions addressed.
|
@wjwwood thanks for the comment, i borrowed your suggestions. |
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> Co-authored-by: William Woodall <william@osrfoundation.org>
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
|
example output for each rmw implementation.
ros2 run examples_rclcpp_minimal_publisher publisher_member_function
# ros2 run examples_rclcpp_minimal_subscriber subscriber_content_filtering
[INFO] [1650647654.909896684] [minimal_contentfiltering_subscriber]: Subscribed to topic "/topic" with content filtering
[INFO] [1650647654.909990922] [minimal_contentfiltering_subscriber]: Content filtering expression and parameter are "data = %0" and "'Hello, world! 10'"
[INFO] [1650647663.337609015] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 10'
[INFO] [1650647663.338324998] [minimal_contentfiltering_subscriber]: Content filtering expression and parameter are "data = %0" and "'Hello, world! 20'"
[INFO] [1650647668.337454893] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 20'
[INFO] [1650647668.338167047] [minimal_contentfiltering_subscriber]: Content filtering expression and parameter are "data = %0" and "'Hello, world! 30'"
...<snip>
# RMW_IMPLEMENTATION=rmw_connextdds ros2 run examples_rclcpp_minimal_subscriber subscriber_content_filtering
RTI Connext DDS Non-commercial license is for academic, research, evaluation and personal use only. USE FOR COMMERCIAL PURPOSES IS PROHIBITED. See RTI_LICENSE.TXT for terms. Download free tools at rti.com/ncl. License issued to Non-Commercial User license@rti.com For non-production use only.
Expires on 00-jan-00 See www.rti.com for more information.
[INFO] [1650647909.339308552] [minimal_contentfiltering_subscriber]: Subscribed to topic "/topic" with content filtering
[INFO] [1650647909.339387411] [minimal_contentfiltering_subscriber]: Content filtering expression and parameter are "data = %0" and "'Hello, world! 10'"
[INFO] [1650647926.630042121] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 10'
[INFO] [1650647926.631364854] [minimal_contentfiltering_subscriber]: Content filtering expression and parameter are "data = %0" and "'Hello, world! 20'"
...<snip>
# RMW_IMPLEMENTATION=rmw_cyclonedds_cpp ros2 run examples_rclcpp_minimal_subscriber subscriber_content_filtering
[WARN] [1650647987.733083073] [minimal_contentfiltering_subscriber]: Content filter is not enabled since it's not supported
[INFO] [1650647990.514812843] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 0'
[INFO] [1650647991.014601673] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 1'
[INFO] [1650647991.514611925] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 2'
[INFO] [1650647992.014454205] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 3'
[INFO] [1650647992.514540176] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 4'
[INFO] [1650647993.014640461] [minimal_contentfiltering_subscriber]: I heard: 'Hello, world! 5'
...<snip> |
|
Note: cross-vendor content filtering works between rmw_fastrtps and rmw_connextdds using this example. |
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
0ab473e to
6bc314e
Compare
|
either @ivanpauno or @wjwwood , could you help to merge this? i do not have access permission for this repo. |
Let's hold off until next week; we are trying to branch for Humble right now. |
|
sorry, forgot that. thanks! |
|
Yeah, this is ready, just waiting on Humble to unblock. |
|
@clalancette could you merge this into master? so that i can link this example from ros2/ros2_documentation#2396 (release note). |
|
@Mergifyio backport rolling humble |
(cherry picked from commit 9ff80f5)
✅ Backports have been createdDetails
|
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> (cherry picked from commit 9ff80f5)
should be linked to ROS 2 ContentFitleredTopic tutorial. (ros2/design#282)
related to ros2/demos#557
Signed-off-by: Tomoya Fujita Tomoya.Fujita@sony.com